home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / source / kernel / ui.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-01  |  4.6 KB  |  114 lines  |  [TEXT/KAHL]

  1. /* Definitions for graphics support not specific to any interface.
  2.    Copyright (C) 1993, 1994, 1995 Stanley T. Shebs.
  3.  
  4. Xconq is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.  See the file COPYING.  */
  8.  
  9. #define NUMPOWERS 8
  10.  
  11. typedef struct a_vp {
  12.     short sx, sy;
  13.     long  totsw, totsh;
  14.     short pxw, pxh;            /* size of window in pixels */
  15.     short power;            /* index to this map's magnification */
  16.     short mag;                /* magnification of each cell (a power of 2) */
  17.     short vcx, vcy;            /* center of the view */
  18.     short hw, hh;            /* pixel dims of a cell */
  19.     short hch;                /* height of cell cell between centers */
  20.     short uw, uh;            /* pixel dims of unit subcell */
  21.     short angle;            /* Angle of perspective view. */
  22. } VP;
  23.  
  24. #define hexagon_adjust(v) (area.xwrap ? 0 : ((area.height / 2) * (v)->hw) / 2)
  25.  
  26. #define REDRAW_CHAR '\001'
  27. #define BACKSPACE_CHAR '\010'
  28. #define ESCAPE_CHAR '\033'
  29. #define DELETE_CHAR 0x7f
  30.  
  31. extern short mags[], hws[], hhs[], hcs[], uws[], uhs[];
  32.  
  33. extern short bwid[], bwid2[], cwid[];
  34.  
  35. extern short bsx[NUMPOWERS][7], bsy[NUMPOWERS][7];
  36. extern short lsx[NUMPOWERS][6], lsy[NUMPOWERS][6];
  37.  
  38. extern short qx[NUMPOWERS][7], qy[NUMPOWERS][7];
  39.  
  40. extern char *dirchars;
  41.  
  42. extern ImageFamily *unseen_image;
  43.  
  44. extern Module **possible_games;
  45.  
  46. extern int numgames;
  47.  
  48. /* Function declarations. */
  49.  
  50. extern void collect_possible_games PROTO ((void));
  51. extern void add_to_possible_games PROTO ((Module *module));
  52.  
  53. extern VP *new_vp PROTO ((void));
  54.  
  55. extern void xform_cell PROTO ((VP *vp, int x, int y, int *sxp, int *syp));
  56. extern void xform_unit PROTO ((VP *vp, Unit *unit, int *sxp, int *syp, int *swp, int *shp));
  57. extern void xform_unit_self PROTO ((VP *vp, Unit *unit, int *sxp, int *syp, int *swp, int *shp));
  58. extern void xform_occupant PROTO ((VP *vp, Unit *transport, Unit *unit, int sx, int sy, int sw, int sh, int *sxp, int *syp, int *swp, int *shp));
  59.  
  60. extern void scale_vp PROTO ((VP *vp, VP *vp2, int *sxp, int *syp, int *swp, int *shp));
  61.  
  62. extern int nearest_cell PROTO ((VP *vp, int sx, int sy, int *xp, int *yp));
  63. extern int nearest_boundary PROTO ((VP *vp, int sx, int sy, int *xp, int *yp, int *dirp));
  64. extern int nearest_unit PROTO ((VP *vp, int sx, int sy, Unit **unitp));
  65.  
  66. extern int cell_is_visible PROTO ((VP *vp, int x, int y));
  67. extern int unit_is_visible PROTO ((VP *vp, Unit *unit));
  68. extern int cell_is_in_middle PROTO ((VP *vp, int x, int y));
  69.  
  70. extern int set_view_size PROTO ((VP *vp, int w, int h));
  71. extern int set_view_position PROTO ((VP *vp, int sx, int sy));
  72. extern int set_view_power PROTO ((VP *vp, int power));
  73. extern int set_view_angle PROTO ((VP *vp, int angle));
  74. extern int set_view_direction PROTO ((VP *vp, int dir));
  75. extern int set_view_focus PROTO ((VP *vp, int x, int y));
  76. extern void center_on_focus PROTO ((VP *vp));
  77. extern void focus_on_center PROTO ((VP *vp));
  78.  
  79. extern void guess_elev_stuff PROTO ((void));
  80. extern Unit *find_unit_or_occ PROTO ((VP *vp, Unit *unit, int usx, int usy, int usw, int ush, int sx, int sy));
  81. extern Unit *find_unit_at PROTO ((VP *vp, int x, int y, int sx, int sy));
  82.  
  83. extern void pick_a_focus PROTO ((Side *side, int *xp, int *yp));
  84.  
  85. extern Unit *autonext_unit PROTO ((Side *side, Unit *unit));
  86. extern int in_box PROTO ((int x, int y, int lx, int ly, int w, int h));
  87. extern Unit *autonext_unit_inbox PROTO ((Side *side, Unit *unit, VP *vp));
  88. extern int could_be_next_unit PROTO ((Unit *unit));
  89.  
  90. extern int num_active_displays PROTO ((void));
  91.  
  92. extern int advance_into_cell PROTO ((Side *side, Unit *unit, int x, int y,
  93.                 Unit *other));
  94.  
  95. extern int give_supplies PROTO ((Unit *unit, short *amts, short *rslts));
  96. extern int take_supplies PROTO ((Unit *unit, short *amts, short *rslts));
  97.  
  98. extern ImageFamily *get_unit_type_images PROTO ((Side *side, int u,
  99.                          void (*interp_hook)(ImageFamily *imf),
  100.                          void (*load_hook)(ImageFamily *imf),
  101.                          void (*default_hook)(ImageFamily *imf, int u, char *name)));
  102. extern ImageFamily *get_terrain_type_images PROTO ((Side *side, int t,
  103.                             void (*interp_hook)(ImageFamily *imf),
  104.                             void (*load_hook)(ImageFamily *imf),
  105.                             void (*default_hook)(ImageFamily *imf, int u, char *name)));
  106. extern ImageFamily *get_unseen_images PROTO ((Side *side,
  107.                             void (*interp_hook)(ImageFamily *imf),
  108.                             void (*load_hook)(ImageFamily *imf),
  109.                             void (*default_hook)(ImageFamily *imf, char *name)));
  110. extern ImageFamily *get_emblem_images PROTO ((Side *side, Side *side2,
  111.                           void (*interp_hook)(ImageFamily *imf),
  112.                           void (*load_hook)(ImageFamily *imf),
  113.                           void (*default_hook)(ImageFamily *imf, int u, char *name)));
  114.